
<?php
$gender = strtolower($athlete->gender);
$gender_icon = "<img src='" . base_url() . "/public/img/$gender.png'>";
$header = '<h1>' . $athlete->getLastName() . ', ' . $athlete->getFirstName() . ' ' . $gender_icon . '<small>' . $athlete->dob_year . ' ' . $athlete->getTeam()->getFullName() . '</small></h1>';
?>

<script>
    $(".page-header").html("<?php echo $header; ?>");
</script>

<div class="row-fluid">
    <div class="span6 clear-fix"><img class="img-polaroid pull-left profile-picture" src="<?php echo base_url() . 'public/img/profile_empty.gif'; ?>"/>
        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit.Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam sit amet posuere dolor. Vestibulum arcu orci, lacinia at facilisis at, vehicula sit amet purus. Morbi vitae interdum felis. Nulla facilisi. Nullam et velit auctor mi lobortis semper non ut nunc. Suspendisse eget magna ac leo fermentum dignissim eget ut urna. Mauris sagittis quam sit amet sem sagittis fringilla.</p>
    </div>

    <div class="span6"">
        <h4>Top 5 tulemust FINA punktide järgi</h4>
        <table class="table table-bordered">
            <tbody>
            <th>#</th>
            <th>Tulemus</th>
            <th>Ala</th>
            <th>Kuupäev</th>
            <th>Bassein</th>
            <th>FINA</th>
            <?php
            $rank = 1;
            foreach ($top_five as $row) {
                echo "<tr><td><strong>$rank</strong></td>";
                echo '<td>' . $row->result . '</td>';
                echo '<td>' . $row->distance . ' ' . Utils::est_stroke($row->stroke, false, true) . '</td>';
                echo '<td>' . Utils::est_date($row->date) . '</td>';
                echo '<td>' . $row->pool . ' m</td>';
                echo '<td>' . $row->fina . '</td></tr>';
                $rank++;
            }
            ?>
            </tbody>
        </table>
    </div>
</div>
<div class="row-fluid">

    <div class="span12">
        <h4>Parimad tulemused alade kaupa</h4>
        <table class="table table-hover">
            <tbody>
            <th>Ala</th>
            <th>Bassein</th>
            <th>Tulemus</th>
            <th>FINA</th>
            <th>Kuupäev</th>
            <th>Asukoht</th>
            <th>Võistlus</th>
            <?php
            foreach ($top_results as $row) {
                echo "<tr>";
                echo '<td>' . $row->distance . ' ' . Utils::est_stroke($row->stroke, false, true) . '</td>';
                echo '<td>' . $row->pool . ' m</td>';
                echo '<td>' . $row->result . '</td>';
                echo '<td>' . $row->fina . '</td>';
                echo '<td>' . Utils::est_date($row->date) . '</td>';
                echo '<td>' . $row->city . ', ' . Utils::getCountryName($row->country) . '</td>';
                echo '<td><a href="' . site_url("competitions/summary/$row->competition_id") . '">' . $row->name . '</a></td>';
                echo '</tr>';
            }
            ?>
            </tbody>
        </table>
    </div>
</div>